package com.cnswhy.cloud.server.core.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;
@ApiModel(value="ProductQueryBo", description = "商品查询BO")
@Data
public class ProductQueryBo{
    private static final Integer DEFAULT_PAGE_SIZE = 20;
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(name="productName", value="商品名称")
    private String productName;

    @ApiModelProperty(name="brandId", value="品牌id")
    private Long brandId;

    @ApiModelProperty(name="classifyId", value="二级分类id")
    private Long classifyId;

    @ApiModelProperty(name="classifyParentId", value="一级分类id")
    private Long classifyParentId;

    @ApiModelProperty(name="merchantId", value="商户id")
    private Long merchantId;

    @ApiModelProperty(name="status", value="状态")
    private Integer status;

    @ApiModelProperty(name="startPrice", value="开始价格")
    private BigDecimal startPrice;

    @ApiModelProperty(name="endPrice", value="结束价格")
    private BigDecimal endPrice;

    /**
     * 推荐类型：1批发区
     */
    @ApiModelProperty(name="recommendType", value="无用")
    private Integer recommendType;

    /**
     * 菜单id
     */
    @ApiModelProperty(name="appMenuId", value="无用")
    private Long appMenuId;

    /**
     * 商品类型id列表
     */
    @ApiModelProperty(name="typeIdList", value="无用")
    private List<Long> typeIdList;

    /**
     * 排序方式 0-综合 1-销量 2-新品 3-价格由低到高 4-价格由高到低
     */
    @ApiModelProperty(name="sortType", value="无用")
    private Integer sortType;

    /**
     * 秒杀区 1是2否
     */
    @ApiModelProperty(name="isSeckill", value="无用")
    private Integer isSeckill;

    /**
     * 查询主页推荐列表
     */
    @ApiModelProperty(name="mainRecommend", value="无用")
    private Integer mainRecommend;

    /**
     * 执行sql的参数
     */
    @ApiModelProperty(name="mainRecommend", value="无用")
    private String[] vipTypeArr;


    /**
     * 查询多个vip类型时的传参
     */
    @ApiModelProperty(name="mainRecommend", value="无用")
    private String vipTypeStr;

    /**
     * 类型ID
     */
    @ApiModelProperty(name="mainRecommend", value="无用")
    private Long typeId;

    @ApiModelProperty(name="spellArea", value="拼购区商品")
    private Integer spellArea;

    @ApiModelProperty(name="spellProduct", value="拼购券商品 0 否 1 是")
    private Integer spellProduct;

    @ApiModelProperty(name="priceId", value="拼购区ID")
    private Long priceId;

    /**
     * 当前页
     */
    @ApiModelProperty(name="currentPage", value="当前页", required = true)
    private Integer currentPage = 1;

    /**
     * 每页记录数
     */
    @ApiModelProperty(name="pageSize", value="每页记录数", required = true)
    private Integer pageSize;

    /**
     * 关键字搜索
     */
    @ApiModelProperty(name="keyword", value="关键字搜索")
    private String keyword;
    /**
     * 开始位置
     */
    @ApiModelProperty(name="start", value="开始位置", required = true)
    private Integer start;

    /**
     * 结束位置
     */
    @ApiModelProperty(name="end", value="结束位置", required = true)
    private Integer end;

    public Integer getCurrentPage()
    {
        if (currentPage == null)
        {
            return 1;
        }
        return currentPage;
    }

    public Integer getPageSize()
    {
        if (pageSize == null)
        {
            return DEFAULT_PAGE_SIZE;
        }
        return pageSize;
    }
}
